package com.example.springboot.entity;

import com.example.springboot.utils.validationgroup.AddGroup;
import com.example.springboot.utils.validationgroup.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;


@Data
@NoArgsConstructor
@ApiModel(value = "User", description = "用户实体类")
public class User {
    private Integer id;
    @ApiModelProperty("用户名")
    @NotBlank(message = "用户名不能为空", groups = {AddGroup.class})
    private String username;
    @ApiModelProperty("密码")
    @NotBlank(message = "密码不能为空", groups = {AddGroup.class})
    private String password;
    @NotNull(message = "昵称不能为空", groups = {UpdateGroup.class})
    private String name;
    @ApiModelProperty("手机号")
    private String phone;
    @ApiModelProperty("邮箱")
    private String email;
    @ApiModelProperty("地址")
    private String address;
    @ApiModelProperty("头像")
    private String avatar;
    @ApiModelProperty("角色")
    private String role;
    private String token;

}
